package pers.exercise.StaticFactoryPattern;

import java.time.LocalDate;

public class LocalDateFactory {

    public static LocalDate fromInt(int yyyyMMdd){
        String strDate = String.valueOf(yyyyMMdd);
        String year = strDate.substring(0, 4);
        String month = strDate.substring(4, 6);
        String day = strDate.substring(6, 8);
        return LocalDate.of(Integer.valueOf(year), Integer.valueOf(month), Integer.valueOf(day));
    }
    
}
